<%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters dialog"} do |f| %>
    <div class="d-flex flex-column flex-lg-row gap-2">
      <%= render 'spree/admin/shared/filters_search_bar', param: :number_cont, label: Spree.t(:number) %>
      <%= button_tag type: 'button', class: 'btn btn-light d-flex align-items-center', data: { action: 'dialog#open' } do %>
        <%= icon "adjustments", class: "mr-1" %>
        <%= Spree.t("admin.filters") %>
      <% end %>
    </div>

  <dialog class="drawer" data-dialog-target="dialog" id="stock-transfers-filters-drawer">
    <%= drawer_header(Spree.t(:filter), 'dialog') %>
    <div class="drawer-body">
    <div class="form-group">
      <%= f.label :reference_cont, Spree.t(:reference) %>
      <%= f.text_field :reference_cont, include_blank: true, size: 15, class: "form-control", data: { filters_target: :input } %>
    </div>
    <div class="form-group">
      <%= f.label :source_location_id_eq, Spree.t(:source) %>
      <%= f.select :source_location_id_eq,
              available_stock_locations_list,
              { include_blank: true },
              data: {
                filters_target: :input,
                controller: 'autocomplete-select'
              } %>
    </div>
    <div class="form-group">
      <%= f.label :destination_location_id_eq, Spree.t(:destination) %>
      <%= f.select :destination_location_id_eq,
              available_stock_locations_list,
              { include_blank: true },
              data: {
                filters_target: :input,
                controller: 'autocomplete-select'
              } %>
    </div>
    <%= render_admin_partials(:stock_transfers_filters_partials, f: f) %>
    </div>
    <div class="drawer-footer">
      <%= drawer_discard_button('dialog') %>
      <div class="form-actions">
        <%= button Spree.t(:search), "search" %>
      </div>
    </div>
  </dialog>

  <%= render "spree/admin/shared/filter_badge_template" %>
  <div data-filters-target="badgesContainer" class="filter-badges-container"></div>
<% end %>
